"""
@author: wy
@file: 字符串压缩.py
@time: 2023/11/17 20:21
"""
num=1
count=1
str1=input("请输入一个字符串:")

for i in str1:
    if num == len(str1):
        print("%s%d" % (i, count), end=" ")
        break
    if i == str1[num]:
        count+=1
    else:
        print("%s%d"%(i,count),end=" ")
        count = 1
    num+=1
